package data.type.and.operator;

import general.DataTypeNOperator;

public class DtoEnum implements DataTypeNOperator{
	enum COLOR {
		 
        RED(5), BLUE(6), YELLOW(7), GREEN(8);
        private int value;
 
        COLOR(int value) {
            this.value = value;
        }
 
        public int getValue() {
            return this.value;
        }
        
        public void setValue(int value)
        {
        	this.value = value;
        }
    };

	@Override
	public void run() {
		COLOR c = COLOR.RED;
        String pre = "Gia tri mau " + c.name() + " la: " + c.getValue();
        if (c.name() == "RED") {
			pre += " \"Nguy hiem\"";
		}
        else if (c.name().equals("BLUE")) {
				pre += " \"Toots\"";
			}	
        System.out.println(pre);
		
	}
	
}
